This invention deals with software branch analysis tools used in testing computer programs. Generally, a well written program undergoes four distinct phases of development: specification, design, coding and test. In the specification phase, the problem which the program is meant to solve, or the task which the program is meant to perform, is specified. In the design phase, a solution to the specified problem, or a method of accomplishing the specified task, is designed. In the coding phase, the design solution or the design method is implemented in writing in a particular computer language, such as FORTRAN, C, PASCAL, or assembly language. Finally, in the test phase the computer program is tested to determine if it meets the specification and design requirements. The purpose of testing is to verify that the program behaves as desired for all possible inputs.
Branch analysis is a test procedure which seeks to determine which sections of a program's code are executed during a run. A computer program consists of a sequence of computer instructions. Generally, the computer executes a program's instructions in the sequential order in which the instructions appear in the program. A branch occurs when an instruction requires jumping, that is, branching, to an instruction other than the next succeeding instruction. A program may branch to a subroutine, or to the top of a nested loop, or to the conditional part of an IF-THEN-ELSE statement, and so forth. For instance, the accessibility of a given branch determined from the branch analysis test phase may lead to a re-design of the program. In particular, branch analysis may reveal coding errors such as branches which are never executed (and are therefore unnecessary).
Prior art branch analysis tools are currently available in either hardware or software implementations. Generally, software implementations offer greater flexibility and ease of use, while hardware tools may offer greater speed. Software tools generally deal with the highest level of code, that is, the source code version of a program, and will actually add new source code to the programs under test. Hardware tools, on the other hand, deal with the lower level assembly language version of a program, and do not add code to the program under test. In its software version, the branch analysis tool is first invoked when a program is compiled.
Prior art software branch analysis tools include the so-called TCAT/C and S-TCAT/C tools provided by Software Research Associates (SRA), P.O. Box 2432, San Francisco, Calif. 94126. The SRA tools are designed for branch analysis of computer programs written in syntactically correct C language. The SRA tools analyze a target C program while the program is running and generate tubular reports which list, among other things, (a) the program modules which were tested, (b) the number of branches in each module, (c) the number of times the module was invoked during the test, (d) the number of branches executed during invocation of the module, and (e) a percent-coverage figure which is the ratio of (d) to (b).
Prior art software branch analysis tools are dependent upon the data input/output (I/O) capability of the host system on which the program under test is running. For instance, when performing branch analysis on a program being run on a personal computer (PC), the prior art tools must use the PC's I/O to store the branch analysis test data on an external mass storage device, such as a disc. This dependency on I/O prohibits branch analysis of programs which run on embedded microprocessor-based systems, that is, microprocessor based systems that do not have access to external mass storage such as the software systems in a microwave oven or in a modern automobile.